package com.itmuch.contentcenter.feignclient;

import com.itmuch.contentcenter.configuration.UserCenterFeignConfiguration;
import com.itmuch.contentcenter.domain.dto.messaging.UserAddBonusDTO;
import com.itmuch.contentcenter.domain.dto.user.UserDTO;
//import com.itmuch.contentcenter.feignclient.fallback.UserCenterFeignClientFallback;
//import com.itmuch.contentcenter.feignclient.fallback.UserCenterFeignClientFallbackFactory;
import com.itmuch.contentcenter.feignclient.fallback.UserCenterFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

//@FeignClient(name = "user-center" ,configuration = UserCenterFeignConfiguration.class)
@FeignClient(name = "user-center"
        ,
//        fallback = UserCenterFeignClientFallback.class
fallbackFactory = UserCenterFeignClientFallbackFactory.class
)
public interface UserCenterFeignClient {
    /**
     * http://user-center/user/{id}
     * @param userId
     * @return
     **/
    @GetMapping("/users/{userId}")
    UserDTO findById(@PathVariable Integer userId);

    @GetMapping("/q")
    UserDTO query(@SpringQueryMap UserDTO userDTO);

    @PutMapping("/users/addBonus")
    void addBonus1(@RequestBody UserAddBonusDTO userAddBonusDTO);

}
